#pragma once

#include <stdbool.h>

struct node{
    int data;
    struct node *next;
};

struct list_stack{
    struct node *top;

    // 调用方法-函数指针
    bool (*empty)(struct list_stack *s);
    bool (*push)(struct list_stack *s, int value);
    bool (*pop)(struct list_stack* s);
    bool (*peek)(struct list_stack *s, int *value);
    void (*show)(struct list_stack *s);
    bool (*init)(struct list_stack *s);
    void (*clear)(struct list_stack *s);
};

bool empty(struct list_stack *s);
bool push(struct list_stack *s, int value);
bool pop(struct list_stack* s);
bool peek(struct list_stack *s, int *value);
void show(struct list_stack *s);
void clear(struct list_stack *s);
bool list_stack_init(struct list_stack *s);